# """manager的作用是启动程序
#     以及托管程序等
#
# """
from flask_wtf.csrf import generate_csrf
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from info import create_app, db
from config import DevelopmentConfig,Pro_Config
from info import models
# app = create_app(DevelopmentConfig)
# manager = Manager(app)
# Migrate(app, db)
# manager.add_command('db', MigrateCommand)





app = create_app(DevelopmentConfig)
# 创建托管对象，拥有命令行
manager = Manager(app)
# 第⼀个参数是Flask的实例，第⼆个参数是Sqlalchemy数据库实例
# 然后创建了Migrate对象,这是为了导出数据库对象
Migrate(app, db)
# manager是Flask-Script的实例，这条语句在flask-Script中添加⼀个db命令
# MigrateCommand提供了控制数据库的命令功能.
manager.add_command('db', MigrateCommand)







if __name__ == '__main__':
    manager.run()























##################################################################



#
# from flask_script import Manager
# from flask_migrate import Migrate, MigrateCommand
# from config import DevelopmentConfig,Pro_Config
# from info import create_app,db
#
#
#
# app = create_app(Pro_Config)
# # 创建托管对象，拥有命令行
# manager = Manager(app)
# # 第⼀个参数是Flask的实例，第⼆个参数是Sqlalchemy数据库实例
# # 然后创建了Migrate对象,这是为了导出数据库对象
# Migrate(app, db)
# # manager是Flask-Script的实例，这条语句在flask-Script中添加⼀个db命令
# # MigrateCommand提供了控制数据库的命令功能.
# manager.add_command('db', MigrateCommand)
#
#
#
# if __name__ == '__main__':
#     manager.run()
#
